﻿
namespace AzureStorageMapper.Criterias.TableStorage
{
    public class Operation
    {
        private object _fieldValue;
        private Criteria _criteria;

        public CriteriaOperator? Opt { get; set; }
        public bool IsValueOperation { get; set; }

        public object FieldValue
        {
            get { return this._fieldValue; }
        }

        public void QueryValue(object obj)
        {
            this._fieldValue = obj;
            this.IsValueOperation = true;
        }

        public Criteria QuerySubCriteria
        {
            get
            {
                if (this._criteria == null)
                    _criteria = new Criteria();

                this.IsValueOperation = false;
                return _criteria;
            }
        }
    }
}
